Moralization and Foreign Policy Attitudes: Replication Materials
9 June 2025
Sarah Maxey and Kathleen E. Powers 
smaxey@luc.edu, Kathleen.E.Powers@dartmouth.edu

List of files:

1. MP_Moralization_Codebook.pdf - the combined codebook for study 1, study 2, study 1 pretest, study 2 pretest

2. MP_study1_data.csv - the data for study 1
3. MP_study1_regions_coded.csv - the data containing coding for US census regions in study 1

4. MP_study1_0.R - this R script contains libraries and functions; generates the coded variables and data subsets necessary to run the other replication files. Run this file      
   first for study 1 analyses!

5. MP_study1_1.R - this R script contains the code to run all study 1 analyses and generate tables and figures reported in the main text. Run MP_study1_0.R first!

6. MP_study1_2.R - this R script contains the code to run all supplemental study 1 analyses and generate tables and figures reported in the supplementary appendix. Run both MP_study1_0.R and MP_study1_1.R first!

7. MP_speechdata.dta - the Presidential speech data for salience validation

8. MP_speechdata_figureB1.do - this Stata .do file contains the code used to generate Figure B.1


9. MP_study2_data.csv - the data for study 2

10. MP_study2_0.R - this R script contains libraries and functions; generates the coded variables and data subsets necessary to run the other replication files. Run this file 
    first for study 2 analyses!

11. MP_study2_1.R - this R script contains the code to run all study 2 analyses and generate tables and figures reported in the main text. Run MP_study2_0.R first!

12. MP_study2_2.R - this R script contains the code to run all supplemental study 1 analyses and generate tables and figures reported in the supplementary appendix. Run both 
    MP_study2_0.R and MP_study2_1.R first!


13. MP_study1_pretest_data.csv - the data for the study 1 pretest

14. MP_study1_pretest.R - this R script contains libraries and functions, codes variables, analyzes the data, and generates tables reported in Appendix A. Run the script in 
    order to replicate Appendix A!


15. MP_study2_pretest_data.csv - the data for the study 2 pretest

16. MP_study2_pretest.R - this R script contains libraries and functions, codes variables, and runs all analyses reported in the manuscript and appendix. Run the script in 
    order to replicate study 2 pre-test analyses reported in the manuscript and appendix!



To replicate the analyses using the scripts above, set your working directory to the replication folder that contains the datasets. 

Script for study 1 loads the following packages (versions used noted in parentheses): foreign (version 0.8-88), psych (version 2.4.6.26), ggplot2 (version 3.5.1), stargazer (version 5.2.3), gridExtra (version 2.3), xtable (version 1.8-4), psych (version 2.4.6.26), reshape2 (version 1.4.4), lmtest (version 0.9-40), sandwich (version 3.1-0), multcomp (version 1.4-26), ggstance (version 0.3.7), plyr (version 1.8.9), car (version 3.1-2)

Script for study 2 loads the following packages (versions used noted in parentheses): foreign (version 0.8-88), ggplot2 (version 3.5.1), xtable (version 1.8-4), psych (version 2.4.6.26), stargazer (version 5.2.3), plyr (version 1.8.9), ggstance (version 0.3.7), gridExtra (version 2.3), MASS (version 7.3-61), interflex (version 1.2.6)

Script for study 1 pretest loads the following packages:  foreign (version 0.8-88), stargazer (version 5.2.3)
 
Script for study 2 pretest loads the following packages:  foreign (version 0.8-88), stargazer (version 5.2.3), plyr (version 1.8.9)


Uncomment lines at top of script in MP_study1_0.R, MP_study2_0.R, MP_study1_pretest.R, and MP_study2_pretest.R to install packages as needed. 

Analyses carried out using R version 4.4.3 in RStudio version 2024.04.2+764 on Lenovo ThinkPad X1 Carbon Gen 12 Intel Core Ultra 7 155U, 1700 Mhz, 12 running Windows 11 Enterprise (and reproduced using R version 4.4.1 in R Studio version 2025.05.0+496 on an M2 Macintosh HD running Sonoma 14.5) 


